//
// Created by Administrator on 2023/7/29.
//
#include <string>
#include <iostream>

using namespace std;

class Solution {
public:
    int countAsterisks(string s) {
        int count = 0;
        bool findBar = false;
        for (char i: s) {
            if (i == '|')
                findBar = !findBar;
            else if (findBar == 0 && i == '*')
                count++;
        }
        return count;
    }
};

int main() {
    Solution s;
    cout << s.countAsterisks("l|*e*et|c**o|*de|") << endl;
    cout << s.countAsterisks("iamprogrammer") << endl;
    cout << s.countAsterisks("yo|uar|e**|b|e***au|tifu|l") << endl;
}